<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />-->
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/Public/favicon.ico" >
<LINK rel="Shortcut Icon" href="/Public/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/Public/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/Public/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/Public/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/Public/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/Public/static/h-ui/css/style.css" />
<link rel="stylesheet" href="/Public/css/page.css">

<link href="/Public/dxk/icheck.css" rel="stylesheet">
<script src="/Public/dxk/icheck.js?v=1.0.2"></script>
              
                <script>
                    $(document).ready(function(){
                        $('.user-sex input').each(function(){
                            var self = $(this),
                                    label = self.next(),
                                    label_text = label.text();

                            label.remove();
                            self.iCheck({
                                checkboxClass: 'icheckbox_sm-blue',
                                radioClass: 'radio_sm-blue',
                                insert: label_text
                            });
                        });
                    });
                </script>
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->

<title>房贷业务</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 房贷业务 <span class="c-gray en">&gt;</span> 房贷列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>


<div class="page-container">
    <form class="form form-horizontal" action="<?php echo U('Index/mortgagelist');?>" method="post">
	<div class="text-c">
		<select name="type" class="select-box inline">
			<option value="8" <?php if($type == 8): ?>selected<?php endif; ?>>买方姓名</option>
			<option value="1" <?php if($type == 1): ?>selected<?php endif; ?>>卖方姓名</option>
			<option value="2" <?php if($type == 2): ?>selected<?php endif; ?>>身份证号</option>
            <option value="3" <?php if($type == 3): ?>selected<?php endif; ?>>房屋地址</option>
            <option value="4" <?php if($type == 4): ?>selected<?php endif; ?>>中介名称</option>
            <option value="5" <?php if($type == 5): ?>selected<?php endif; ?>>签单人</option>
            <option value="6" <?php if($type == 6): ?>selected<?php endif; ?>>营销人</option>
            <option value="7" <?php if($type == 7): ?>selected<?php endif; ?>>银行总行</option>
            <option value="9" <?php if($type == 9): ?>selected<?php endif; ?>>信贷员</option>
		</select>
		<input type="text" name="content" id="content"  style="width:250px" class="input-text" value="<?php echo ($content); ?>">
		<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i>搜索</button>
    </form>
	</div>

	<div class="cl pd-5 bg-1 bk-gray mt-20">
	     <span class="l">
	     <?php if(strstr($user_auth['level'],"38")){ ?>
	     <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
	     <?php } ?>
	     <?php if(strstr($user_auth['level'],"26")){ ?>
	     <a class="btn btn-primary radius" onclick="picture_add('建档','<?php echo U('Index/mortgageadd');?>')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i>建档</a>
	     <?php } ?>
	     <?php if(strstr($user_auth['level'],"42")){ ?>
	     <a class="btn btn-primary radius" onclick="dataturn()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i>转入市区</a>
	     <?php } ?></span>
	     <span class="r">共有数据：<strong><?php echo ($documentcount); ?></strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
      <?php if($user_auth['roleid'] != 8): ?><thead>
  				<tr class="text-c">
  					<th width="25"><input type="checkbox" name="quan" value=""></th>
  					<th width="130">姓名</th>
  					<th width="80">贷款银行</th>
            <th width="80">信贷员</th>
  					<th width="120">贷款总金额(万元)</th>
  					<th width="120">建档时间</th>
  					<th width="120">送审时间</th>
  					<th width="120">银行审批完成时间</th>
  					<th width="120">实际放款时间</th>
  					<th width="70">监管类型</th>
            <th width="70">签单人</th>
            <th width="60">操作</th>
  				</tr>
  			</thead>
  			<tbody>
  			    <?php if(is_array($document)): $i = 0; $__LIST__ = $document;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="text-c">
  					<td><input type="checkbox" value="<?php echo ($vo["doc_id"]); ?>" name="id"></td>
  					<td><u style="cursor:pointer" class="text-primary" onClick="article_edit('查看','<?php echo U('Index/mortgagealert',array('doc_id'=>$vo['doc_id']));?>','10001')" title="查看"><?php echo ($vo["buy_name"]); ?>&nbsp;<?php if($vo["doc_type"] == '1'): ?>(急下款)<?php elseif($vo["doc_type"] == '2'): ?>(快易贷)<?php elseif($vo["doc_type"] == '3'): ?>(尾款垫资)<?php elseif($vo["doc_type"] == '4'): ?>(赎楼解押)<?php elseif($vo["doc_type"] == '5'): ?>(直通车)<?php endif; ?></td>
  					<td><?php echo (getBankName($vo["bank_id"])); ?></td>
            <td><?php echo ((isset($vo["loan"]) && ($vo["loan"] !== ""))?($vo["loan"]):""); ?></td>
  					<td><?php echo ($vo["amount"]); ?></td>
  					<td><?php if($vo["create_time"] != ''): echo (date("Y-m-d",$vo["create_time"])); endif; ?></td>
            <td><?php if($vo["audit_time"] != ''): echo (date("Y-m-d",$vo["audit_time"])); endif; ?></td>
            <td><?php if($vo["audit_finish"] != ''): echo (date("Y-m-d",$vo["audit_finish"])); endif; ?></td>
            <td><?php if($vo["credit_real_time"] != ''): echo (date("Y-m-d",$vo["credit_real_time"])); endif; ?></td>
            <td><?php if($vo['supervise'] == 1): ?>贷款监管<?php endif; ?>
            <?php if($vo['supervise'] == 2): ?>全款监管<?php endif; ?>
            <?php if($vo['supervise'] == 3): ?>不监管<?php endif; ?></td>
  					<td><?php echo ($vo["signname"]); ?></td>
            <td>
            <?php
 if($vo['state']=='2'){ if($user_auth['roleid']=='4'){ ?>
            <a style="text-decoration:none" class="ml-5" onClick="article_edit('解锁','<?php echo U('Index/mortgagealert',array('doc_id'=>$vo['doc_id'],'type'=>'1'));?>')" href="javascript:;" title="审核">已退案</a>
            <?php
 } else{ ?>
            已退案
            <?php
 } } elseif(empty($vo['certificate_time'])){ ?>
            正在审核
            <?php
 }else{ ?>
            审核完成
            <?php
 } ?>
            </td>


  				</tr><?php endforeach; endif; else: echo "" ;endif; ?>
  			</tbody>

      <?php elseif($user_auth['roleid'] == 8): ?>
      <thead>
        <tr class="text-c">
          <th width="25"><input type="checkbox" name="quan" value=""></th>
          <th width="130">姓名</th>
          <th width="130">电话号码</th>
          <th width="80">贷款银行</th>
          <th width="120">贷款总金额(万元)</th>
          <th width="120">建档时间</th>
          <th width="120">收费信息</th>
          <th width="120">营销人</th>
          <th width="120">银行审批完成时间</th>
          <th width="120">实际放款时间</th>
        </tr>
      </thead>
      <tbody>
          <?php if(is_array($document)): $i = 0; $__LIST__ = $document;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="text-c">
          <td><input type="checkbox" value="<?php echo ($vo["doc_id"]); ?>" name="id"></td>
          <td><u style="cursor:pointer" class="text-primary" onClick="article_edit('查看','<?php echo U('Index/mortgagealert',array('doc_id'=>$vo['doc_id']));?>','10001')" title="查看"><?php echo ($vo["buy_name"]); ?>&nbsp;<?php if($vo["doc_type"] == '1'): ?>(急下款)<?php elseif($vo["doc_type"] == '2'): ?>(快易贷)<?php elseif($vo["doc_type"] == '3'): ?>(尾款垫资)<?php elseif($vo["doc_type"] == '4'): ?>(赎楼解押)<?php elseif($vo["doc_type"] == '5'): ?>(直通车)<?php endif; ?></u></td>
          <td><?php echo (getTel($vo["doc_id"])); ?></td>
          <td><?php echo (getBankName($vo["bank_id"])); ?></td>
          <td><?php echo ($vo["amount"]); ?></td>
          <td><?php if($vo["create_time"] != ''): echo (date("Y-m-d",$vo["create_time"])); endif; ?></td>
          <td><?php echo ($vo["charge"]); ?></td>
          <td><?php echo (getUsername($vo["market_id"])); ?></td>
          <td><?php if($vo["audit_finish"] != ''): echo (date("Y-m-d",$vo["audit_finish"])); endif; ?></td>
          <td><?php if($vo["credit_real_time"] != ''): echo (date("Y-m-d",$vo["credit_real_time"])); endif; ?></td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
      </tbody><?php endif; ?>
		</table>
	</div>
	<div class="manu"><?php echo ($page); ?></div>

</div>


<script type="text/javascript" src="/Public/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/Public/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript">


/*建档-添加*/
function picture_add(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*资讯-编辑*/
function article_edit(title,url,id,w,h){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}

// function member_edit(title,url,w,h){
//   layer_show(title,url,w,h);
// }
// 全选
$('input[name=quan]').change(function(){
    $('input[name=id]').prop("checked",this.checked);
})
// 删除
function datadel(){
	var chk_value =[];
   $('input[name="id"]:checked').each(function(){
   chk_value.push($(this).val());
  });

  if(chk_value.length==0){
    layer.msg('您还没有选择要删除的数据');
  }
  else{
    $.ajax({
           type:"post",
           url:"<?php echo U('Index/delDatas');?>",
           data:{id:chk_value},
           dataType:'json',
           success:function(msg){
               if(msg.ResultCode=='200'){
                 layer.msg(msg.ResultMessage,{time:1000},  function(){
                   window.location.reload();
                 });
               }
               else{layer.msg(msg.ResultMessage)}
           }
       });
  }
}
function dataturn(){
	var chk_value =[];
   $('input[name="id"]:checked').each(function(){
   chk_value.push($(this).val());
  });

  if(chk_value.length==0){
    layer.msg('您还没有选择要转入的数据');
  }
  else{
    $.ajax({
           type:"post",
           url:"<?php echo U('Index/turnDatas');?>",
           data:{id:chk_value},
           dataType:'json',
           success:function(msg){
               if(msg.ResultCode=='200'){
                 layer.msg(msg.ResultMessage,{time:1000},  function(){
                   window.location.reload();
                 });
               }
               else{layer.msg(msg.ResultMessage)}
           }
       });
  }
}


</script>
</body>
</html>